package cn.controller.marketing;

import cn.service.marketingService.MarketingServiceImpl.AdlistServiceImpl;
import entity.marketingEntity.Adlist;
import entity.marketingEntity.AdlistCondition;
import entity.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 朱颢阳
 * @description
 * @time 2024/8/30 19:00
 */
@RestController
@CrossOrigin
@RequestMapping("/marketing")
public class AdlistController {
    @Autowired
    AdlistServiceImpl service;
    @RequestMapping("/getAdlist")
    public Result getAdlist(@RequestBody AdlistCondition condition){
        return service.getAdlist(condition);
    }
    @RequestMapping("/updateAdlistState")
    public Result updateAdlistState(Integer id,Integer state){
        return service.updateAdlistState(id,state);
    }
    @RequestMapping("/addAdlist")
    public Result addAdlist(@RequestBody Adlist adlist){
        return service.addAdlist(adlist);
    }
    @RequestMapping("/deleteAdlist")
    public Result deleteAdlist(Integer id){
        return service.deleteAdlist(id);
    }
    @RequestMapping("/getAdInfo")
    public Result getAd(Integer id){
        return service.getAd(id);
    }
    @RequestMapping("/updateAdlist")
    public Result updateAdlist(@RequestBody Adlist adlist){
        return service.updateAdlist(adlist);
    }
}
